<template>
  <uni-nav-bar
    title="安蓝卡车后市场服务平台"
    color="#333"
    left-icon="left"
    @clickLeft="navBack"
	:fixed="true"
    statusBar
  ></uni-nav-bar>
  <image :src="image" mode="aspectFill" style="width: 100%;height: 94vh;" :show-menu-by-longpress="true"></image>
  <webWechat :path="path" :title="text"></webWechat>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import { navBack } from '@/utils/navigator';
import webWechat from '@c/pobulic/webWechat.vue';
import { toPublish } from '@mqtt';
import { onLoad } from '@dcloudio/uni-app';
import { recharge_image } from '@/gql/account';
import { useUserStore } from '@/stores/user';
const userInfo = useUserStore();
const orderID = ref();
const image = ref('');
const path = ref('');
const text = ref('');
onLoad((pearm) => {
  orderID.value = pearm.id;
  path.value = `https://wx.anlan.tech/#/?type=deputy&orderId=${pearm.id}`;
  text.value = '帮'+userInfo.nickname+'的代理充值单'
  init();
});
function init() {
  const payload = {
    query: recharge_image,
    variables: { order_id: Number(orderID.value) },
  };
  toPublish('ql/driver/getRechargeImage', payload, (obj: { data: any }) => {
    const { data } = obj;
    image.value = data.recharge_image.image;
  });
}
</script>

<style scoped lang="less"></style>
